Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Implement get_keys, wait_vblank in kandinsky #746

Closed
wants to merge 2 commits into from

Conversation

boricj
Copy link
Contributor

@boricj boricj commented Oct 25, 2018

These functions are already directly provided by kandinsky, might as well expose them to Python. Still a far cry from what we can do (#416), but these functions are essentially free to implement.

@boricj
Copy link
Contributor Author

boricj commented Feb 2, 2019

I've added blitting and key reading functions, so one can make "real" games on the calculator now (proof: https://workshop.numworks.com/python/jblbeurope/pong).

Drawing performance is disappointing, probably because the framebuffer isn't memory-mapped, but it's usable as long as one doesn't attempt to redraw the entire screen in real time. The only way to achieve good drawing performance would be to "race" the beam by redrawing the entire screen in one go (like GESTE did), but that would be quite the challenge to do it quickly enough from within MicroPython...

I've moved the Python interrupt key to the Home button. Not sure if that's a welcome change, but two main buttons is better than one and it's less likely someone would exit out of a Python script while trying to hit the OK key.

@boricj
Copy link
Contributor Author

boricj commented Mar 18, 2019

I've updated the PR and the pong code sample to match #925. I also removed everything that isn't needed for that issue, except for key bindings changes in the simulator to make the Python app bearable with the keyboard.

I can't compile/test this on a real device for now, hopefully it'll work on the first try.

@boricj boricj changed the title [python] Implement draw_line, fill_rect in kandinsky [python] Implement get_keys, fill_rect, wait_vblank in kandinsky Mar 18, 2019
@adriweb
Copy link
Contributor

adriweb commented Apr 27, 2019

fill_rect is now available with 926b96c + 8308068

@boricj
Copy link
Contributor Author

boricj commented Apr 30, 2019

@adriweb I noticed. I'm experimenting with tilemapping from Python right now in an attempt to justify a set_pixels method (and create games that look a bit better than those from an Atari 2600), but the non-intrusive ways I've tried are extremely non-optimal (MicroPython runs out of memory above 16 8x8 tiles, and that's just the tileset...). Overcoming this would require exposing epsilon's shared data storage as read-only files and adding text+binary record types, but I highly doubt the NumWorks team would be interested... Looks like the only thing we'll ever tilemap here will be the character table >_<

@boricj boricj changed the title [python] Implement get_keys, fill_rect, wait_vblank in kandinsky [python] Implement get_keys, wait_vblank in kandinsky May 28, 2019
@boricj
Copy link
Contributor Author

boricj commented May 28, 2019

I've updated the PR and removed what's implemented upstream now. The get_keys method returns a set of strings representing the currently pressed keys ; it's both easy to manipulate with set operators and fairly generic.

@boricj boricj force-pushed the python_kandinsky_moar branch 2 times, most recently from 6c41286 to 256b67e Compare June 6, 2019 19:06
@boricj
Copy link
Contributor Author

boricj commented Jun 6, 2019

Per #992, removing commit concerning FLTK simulator.

@Ecco
Copy link
Contributor

Ecco commented Nov 15, 2019

Hi @boricj ! Thanks for this PR!

I'm suggesting #1201 , see #925 for explanations.

@eli-sauvage
Copy link

be careful, up and right are inverted

@Ecco
Copy link
Contributor

Ecco commented Nov 25, 2019

Indeed, good catch. But this PR has been superseeded by #1201 anyway, so I'm closing this one.

@Ecco Ecco closed this Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants